library(ggplot2)
library(scales)

dfnew<-read.csv("1_1L2_CFAM_viscosity.csv")

#plot viscosity at different times
ggplot(dfnew, aes(x=Time, y=meanViscosity, color = sample, group = sample, linetype= sample)) +
  geom_line(size=1)+
  geom_point(size=2, show.legend = F)+
  scale_linetype_manual(values = c("solid", "solid", "dashed", "solid", "dashed", "twodash", "solid"))+
  scale_color_manual(values= c("goldenrod2","maroon2", "maroon2","forestgreen","forestgreen", "forestgreen", "black"))+
  geom_errorbar(aes(ymin=meanViscosity-StDevViscosity, ymax=meanViscosity+StDevViscosity, linetype= NULL), position = position_dodge(width = 10), width=60, show.legend = F) + scale_y_continuous(labels = comma) +
  theme_minimal() +
  labs(
    title = "",
    x = "Time (s)",
    y = "Viscosity (mPa·s)"
  )+
  theme(axis.text.x = element_text(size = 14), axis.text.y = element_text(size = 14), axis.title.y = element_text(size=18), axis.title.x = element_text(size=18), title = element_text(size = 16), legend.title = element_blank(), legend.text = element_text(size=14), legend.key.height = unit(0.9, "cm"),legend.key.size =  unit(0.5, "in"))